package com.example.mapper;

import com.example.entity.ActivitySignup;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ActivitySignupMapper {
    @MapKey("id")
    List<Map<String, Object>> selectMyActivitiesWithDetail(Long userId);

    ActivitySignup selectByActivityAndUser(@Param("activityId") Long activityId,
                                           @Param("userId") Long userId);

    int countValidSignups(Long activityId);

    int insert(ActivitySignup activitySignup);

    int update(ActivitySignup activitySignup);

    ActivitySignup selectById(Long id);


    List<ActivitySignup> selectAll(@Param("userId") Long userId,
                                   @Param("status") Integer status,
                                   @Param("title") String title,
                                   @Param("activityType") Integer activityType);

}
